package com.scs.application.modules.design.dto;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Maps;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Map;

/**
 * @description:
 */
@Data
@Accessors(chain = true)
public class QueryContext {

    private Map<String,Object> params;

    private QueryWrapper wrapper;

    private Page page;

    public Map<String, Object> getParams() {
        return params == null ? Maps.newHashMap() : params;
    }

    public QueryWrapper getWrapper() {
        return wrapper == null ? new QueryWrapper() : wrapper;
    }

    public Page getPage() {
        return page == null ? new Page() : page;
    }
}
